package com.khstudio.videocapture;

import android.app.Activity;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;

import com.khstudio.api.util.KhLog;
import com.khstudio.videocapture.khvideocapture.KhVideoCaptureFragment;

public class KhVideoCaptureActivity extends Activity {
    private String mInPath;

    private KhVideoCaptureFragment mKhVideoCaptureFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        KhLog.i("KhVideoEditActivity : onCreate");

        setContentView(R.layout.kh_activity_khvideocapture);

        mInPath = null;

        Intent intent = getIntent();
        if(intent != null) {
            mInPath = intent.getStringExtra("path");
            KhLog.i("KhVideoEditActivity : Path = %s", mInPath);
        }

        FragmentManager fm = getFragmentManager();
        mKhVideoCaptureFragment = (KhVideoCaptureFragment) fm.findFragmentById(R.id.kh_videocapture_fragment);
        mKhVideoCaptureFragment.setDataSource(mInPath);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return true;
    }
}
